#ifndef TICKETCHANGESET_H
#define TICKETCHANGESET_H

#include <QtCore/QString>
#include <QtCore/QStringList>
#include <QtCore/QVariant>
#include <QtCore/QDateTime>
#include <QtCore/QDebug>

class TicketAction {
public:
    TicketAction(const QString &action, const QString &label, const QString &hint = "");

    TicketAction(const QString &action, const QString &label, const QString &hint,
                 const QString &inputName, const QString &inputValue,
                 const QStringList &allowedFields);

    QString action() const;
    QString label() const;
    QString hint() const;

    QString inputName() const;
    QString inputValue() const;
    QStringList allowedFields() const;

    // Create a (newly allocated) copy of the given TicketAction
    TicketAction *dup();

    void setInputFieldName(const QString &name);
    void setInputFieldValue(const QString &value);
    void setAllowedFields(const QStringList &fields);

private:
    QString m_action;
    QString m_label;
    QString m_hint;

    QString m_inputFieldName;
    QString m_inputFieldValue;
    QStringList m_allowedFields;
};

QDebug operator<<(QDebug debug, const TicketAction *action);

class TicketChangeset {
public:
    TicketChangeset(const QDateTime &timestamp, const QString &author);

    void addField(const QString &field, const QVariant &data);

    QDateTime timestamp() const;
    QString author() const;
    QVariantMap changedFields() const;
private:
    QDateTime m_timestamp;
    QString m_author;
    QVariantMap m_fields;

    int flags; // Future use
};



#endif // TICKETCHANGESET_H
